package com.cml.client.common.context;

import com.cml.client.domain.service.ServiceInstanceService;
import com.cml.client.infrastructure.NetworkManager;

/**
 * 姓名：陈茂林
 * 时间：2023/12/6
 * 描述：
 */
public class ApplicationContext {
    private ServiceInstanceService serviceInstanceService;
    private NetworkManager networkManager;

    public ServiceInstanceService getServiceInstanceService() {
        return serviceInstanceService;
    }

    public NetworkManager getNetworkManager() {
        return networkManager;
    }

    public static class Builder{
        private  ApplicationContext applicationContext;

        public Builder(){
            applicationContext = new ApplicationContext();
            applicationContext.serviceInstanceService= new ServiceInstanceService(applicationContext);
            applicationContext.networkManager=new NetworkManager(applicationContext);
        }

        public ApplicationContext build(){
            return applicationContext;
        }
    }
}
